package com.azier.kapacitor.script.node;

import com.azier.kapacitor.script.method.*;
import com.azier.kapacitor.script.node.nodebind.CommonNodeBind;

import java.util.ArrayList;

/**
* 1 * @Author: luoj
* 2 * @Date: 2019/11/8 11:27
* 3
*/

/**
Create a new Barrier node that emits a BarrierMessage periodically
**/

/**
创建一个新的Barrier节点，该节点定期发出BarrierMessage
**/
public class K8sAutoscaleNode extends AbstractNode implements CommonNodeBind{
    private static final String name = "k8sAutoscale";

    public K8sAutoscaleNode() {
        super(new ArrayList<>(),new ArrayList<>(),name);
    }

    public K8sAutoscaleNode cluster(String value){
        Cluster cluster = new Cluster(value);
        super.addMethod(cluster);
        return this;
    }

    public K8sAutoscaleNode currentField(String value){
        CurrentField currentField = new CurrentField(value);
        super.addMethod(currentField);
        return this;
    }

    public K8sAutoscaleNode decreaseCooldown(long interval, String durationLiteral){
        DecreaseCooldown decreaseCooldown = new DecreaseCooldown(interval, durationLiteral);
        super.addMethod(decreaseCooldown);
        return this;
    }

    public K8sAutoscaleNode increaseCooldown(long interval, String durationLiteral){
        IncreaseCooldown increaseCooldown = new IncreaseCooldown(interval, durationLiteral);
        super.addMethod(increaseCooldown);
        return this;
    }

    public K8sAutoscaleNode kind(String value){
        Kind kind = new Kind(value);
        super.addMethod(kind);
        return this;
    }

    public K8sAutoscaleNode kindTag(String value){
        KindTag kindTag = new KindTag(value);
        super.addMethod(kindTag);
        return this;
    }

    public K8sAutoscaleNode max(Long value){
        Max max = new Max(value);
        super.addMethod(max);
        return this;
    }
    public K8sAutoscaleNode min(Long value){
        Min min = new Min(value);
        super.addMethod(min);
        return this;
    }

    public K8sAutoscaleNode namespace(String value){
        Namespace namespace = new Namespace(value);
        super.addMethod(namespace);
        return this;
    }

    public K8sAutoscaleNode namespaceTag(String value){
        NamespaceTag namespaceTag = new NamespaceTag(value);
        super.addMethod(namespaceTag);
        return this;
    }

    public K8sAutoscaleNode quiet(){
        Quiet quiet = new Quiet();
        super.addMethod(quiet);
        return this;
    }

    public K8sAutoscaleNode replicas(String condition){
        Replicas replicas = new Replicas(condition);
        super.addMethod(replicas);
        return this;
    }

    public K8sAutoscaleNode resourceName(String value){
        ResourceName resourceName = new ResourceName(value);
        super.addMethod(resourceName);
        return this;
    }

    public K8sAutoscaleNode resourceNameTag(String value){
        ResourceNameTag resourceNameTag = new ResourceNameTag(value);
        super.addMethod(resourceNameTag);
        return this;
    }

    public K8sAutoscaleNode resourceTag(String value){
        ResourceTag resourceTag = new ResourceTag(value);
        super.addMethod(resourceTag);
        return this;
    }
}